// 云函数入口文件
const cloud = require('wx-server-sdk')
cloud.init()

// 云函数入口函数
exports.main = async (event, context) => {
 
  if (event.action == "changeClinicPicHome") {
    return await cloud.database().collection('clinicPic').doc("b00064a7604c674509c66792774355cd").update({
        data: {
          clinicPicHome: event.clinicPicHome,
        }
      })
      .then(res => {
        return res
      }).catch(res => {
        return res
      })
  } 
  else if (event.action == "changeClinicPicClinic") {
    return await cloud.database().collection('clinicPic').doc("b00064a7604c674509c66792774355cd").update({
        data: {
          clinicPicClinic: event.clinicPicClinic,
        }
      })
      .then(res => {
        return res
      }).catch(res => {
        return res
      })
  } 
  else if (event.action == "find") {
    return await cloud.database().collection('clinicPic').get()
      .then(res => {
        return res
      }).catch(res => {
        return res
      })
  }
}